/*
 * @Author: Zeratul
 * @Date: 2020-08-24 02:30:44
 * @LastEditTime: 2020-08-24 05:01:02
 * @FilePath: \sz-h5-2003-react-mobile\zhangminhui\eleme-react\eleme-user\src\store\actionCreator\loginAction\index.js
 */
import { CHANGEINPUTTEL, CHANGEINPUTPASSWORD, LOGIN } from "../../actionType";
import axios from "axios";
import qs from 'qs'
const changeInputTelAction = (params) => ({
  type: CHANGEINPUTTEL,
  params,
});
const changeInputPasswordAction = (params) => ({
  type: CHANGEINPUTPASSWORD,
  params,
});
const handleLoginAction = (dispatch) => {
  return function () {
    const options = {
        method: 'POST',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
        data:qs.stringify({ telephone: 18894422908, password: "123456" }),
        url:"http://localhost:10800/api/user/login"
      };
    axios(options)
      .then((res) => {
        console.log(res);
      });
  };
};

export { changeInputTelAction, changeInputPasswordAction, handleLoginAction };
